package com.xiaocikuai.smallchunks.controller.JTEController;

import com.alibaba.fastjson.JSONObject;
import com.yl.jms.sdk.JtExpressApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * 云路供应链科技有限公司 版权所有 © Copyright 2021
 *
 * @Description: 网点信息及三段码查询
 * @Author: xuyangyang
 * @Date: 2020/12/29 15:38
 */
@RestController
public class NetworkAndCodeController {

    /**
     * 网点信息及三段码查询接口地址
     */
    public static final String url = "http://test-openapi.jtexpress.com.cn/webopenplatformapi/api/network/getInfo";

    @Autowired
    private JtExpressApi jtExpressApi;

    @GetMapping("/getInfo")
    public JSONObject getInfo() throws IOException {
        Map<String, Object> map = new HashMap<>();
        map.put("province","重庆");
        map.put("city","重庆");
        map.put("area","九龙坡区");
        map.put("details","金科绿韵康城2栋11-4");
        JSONObject location = jtExpressApi.post(map,url);
        return location;
    }
}
